package com.yooohooo.designpattern.factory;

import com.yooohooo.designpattern.bean.phone.ApplePhone;
import com.yooohooo.designpattern.bean.phone.Phone;
import com.yooohooo.designpattern.bean.phone.SonyPhone;

/**
 * @ClassName: FunctionFactory
 * @Description:
 * @author Yooo
 * @date 2017年6月16日 上午1:43:30
 * 
 */
public class SimplePhoneFactory {
	public static Phone getPhone(int brand) {
		if (brand == 0) {
			ApplePhone applePhone = new ApplePhone();
			applePhone.setBrand("Apple");
			applePhone.setOs("IOS");
			return applePhone;
		}

		SonyPhone sonyPhone = new SonyPhone();
		sonyPhone.setBrand("Sony");
		sonyPhone.setOs("Android");
		return sonyPhone;
	}
}
